package com.td.library.config;

import java.util.Locale;

/**
 * 文件类型枚举类
 */
public enum FileType {
    // 所有文件类型
    FILE(new String[]{""}, "所有"),
    IMAGE(new String[]{"jpg", "bmp", "jpeg", "png"}, "图片"),
    AUDIO(new String[]{"mp3", "wav", "flac"}, "音频"),
    VIDEO(new String[]{"mp4", "mjpeg"}, "视频"),
    DOCUMENT(new String[]{"xml", "xlsx", "doc", "docx", "pdf", "txt"}, "文档"),
    OTHER(new String[]{""}, "其他");

    private String[] fileSuffix;
    private String typeName;

    FileType(String[] fileSuffix, String typeName) {
        this.fileSuffix = fileSuffix;
        this.typeName = typeName;
    }

    public String[] getFileSuffix() {
        return fileSuffix;
    }

    public String getTypeName() {
        return typeName;
    }

    /**
     * 获取文件目录名
     *
     * @return 文件目录名
     */
    public String getFileDirectoryName() {
        return name().toLowerCase(Locale.ROOT);
    }
}
